<template>
  <div>
    <el-button size="mini" type="primary" :icon="isView ? 'el-icon-search' : 'el-icon-edit'" @click="to"/>
    <eForm ref="form" :sup_this="sup_this" :is-add="false" :is-view="isView"/>
  </div>
</template>
<script>
import eForm from './form'
export default {
  components: { eForm },
  props: {
    isView: {
      type: Boolean,
      required: true
    },
    data: {
      type: Object,
      required: true
    },
    sup_this: {
      type: Object,
      required: true
    }
  },
  methods: {
    to() {
      const _this = this.$refs.form
      _this.form = {
        id: this.data.id,
        orderCode: this.data.orderCode,
        orderSource: this.data.orderSource,
        sourceId: this.data.sourceId,
        status: this.data.status,
        serviceLevel: this.data.serviceLevel,
        contractId: this.data.contractId,
        faultType: this.data.faultType,
        supplier: this.data.supplier,
        addriveTime: this.data.addriveTime,
        serviceTime: this.data.serviceTime,
        requireTool: this.data.requireTool,
        notes: this.data.notes,
        assignOperator: this.data.assignOperator,
        assignTime: this.data.assignTime,
        acceptOperator: this.data.acceptOperator,
        acceptTime: this.data.acceptTime,
        engineer: this.data.engineer
      }
      _this.dialog = true
    }
  }
}
</script>

<style scoped>
  div{
    display: inline-block;
    margin-right: 3px;
  }
</style>
